import VueRouter from "vue-router";

export default new VueRouter({
    //去掉url中的#
    mode: 'history',
    routes: [
        {
            path: "/",
            name: "manage",
            component: () => import("./Manage.vue"),
            redirect: '/index',
            children: [
                {
                    path: "index",
                    name: "index",
                    meta: {
                        title: "首页"
                    },
                    component: () => import("./views/index.vue")
                },
                {
                    path: "user",
                    name: "user",
                    meta: {
                        title: "系统管理 / 用户管理"
                    },
                    component: () => import("./views/sys/user.vue")
                },
                {
                    path: "file",
                    name: "file",
                    meta: {
                        title: "系统管理 / 文件管理"
                    },
                    component: () => import("./views/sys/file.vue")
                },
                {
                    path: "role",
                    name: "role",
                    meta: {
                        title: "系统管理 / 角色管理"
                    },
                    component: () => import("./views/sys/role.vue")
                },
                {
                    path: "menu",
                    name: "menu",
                    meta: {
                        title: "系统管理 / 菜单管理"
                    },
                    component: () => import("./views/sys/menu.vue")
                },
                {
                    path: "checkin",
                    name: "checkin",
                    meta: {
                        title: "签到"
                    },
                    component: () => import("./views/checkin.vue")
                },
                {
                    path: "upload",
                    name: "upload",
                    meta: {
                        title: "教程 / 文件上传"
                    },
                    component: () => import("./views/course/upload.vue")
                },
                {
                    path: "share",
                    name: "share",
                    meta: {
                        title: "教程 / 全部文件"
                    },
                    component: () => import("./views/course/share.vue")
                },
                {
                    path: "collect",
                    name: "collect",
                    meta: {
                        title: "教程 / 收藏"
                    },
                    component: () => import("./views/course/collect.vue")
                },
                {
                    path: "userMsg",
                    name: "userMsg",
                    meta: {
                        title: "个人信息"
                    },
                    component: () => import("./views/userMsg.vue")
                },
            ]
        },
        {
            path: "/login",
            name: "login",
            meta: {
                title: "登录"
            },
            component: () => import("../components/login/login.vue")
        },
        {
            path: "/register",
            name: "register",
            meta: {
                title: "注册"
            },
            component: () => import("../components/login/register.vue")
        }
    ]
})